package day05.HomeWork;

import java.sql.Array;
import java.util.Arrays;
import java.util.Random;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/5 18:43
 */
public class homeWork2 {
    public static void main(String[] args) {
        int[] aa={1,4,5,67,2};
        System.out.println(aa[3]);
        int cc=aa[0];
        for (int i=0; i<aa.length; i++){
            System.out.println(aa[i]);
            if (cc<aa[i]){
                cc=aa[i];
            }
        }
        System.out.println("数组aa的最大值"+cc);
        int[]bb= Arrays.copyOf(aa,7);
        System.out.println(Arrays.toString(bb));






        say();
        say("lihua");
        say("liua",57);
        sum(2,3);
        System.out.println("________");
        generateArray(5,10);
    }
    public static void say(){
        System.out.println("订阅");
    }
    public static void say(String name){
        System.out.println("手动");
    }
    public static void say(String name,int age){
        if (age>60){
            return;
        }
        System.out.println("电视剧");
    }
    public static int sum(int bb,int cc){
        int dd=bb+cc;
        System.out.println(dd);
        int ee=bb-cc;
        System.out.println(ee);
        return dd;
    }
    public static int generateArray(int length,int max){
        Random rand=new Random();
        int[]ll=new int [length];
        for (int i=0;i<length;i++){
            ll[i]=rand.nextInt(max);
            System.out.println(ll[i]);
        }
        int hdjf=ll[0]+ll[2];
        return hdjf;
    }
}
